// 排序算法

// 插入排序
const insertSort = (arr) => {
  let len = arr.length
  for (let i = 1; i < len; i++) {
    for (let j = i; j > 0; j--) {
      if (arr[j] < arr[j - 1]) {
        let temp = arr[j]
        arr[j] = arr[j - 1]
        arr[j - 1] = temp
      } else {
        break
      }
    }
    console.log(`第${i}趟排序后：${arr}`)
  }
}

let arr = [9, 1, 5, 8, 3, 7, 4, 6, 2]
// insertSort(arr)

let func = () => {
  console.log(arguments)
  // console.log('arguments==', arguments)
  let key = Array.prototype.shift.call(arguments)
  console.log('key', key)
  // console.log(arguments)
}
func('zhen')
